-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't test issue-44056.rs on non-AVX hardware #55667
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Actually I am unsure if that should be |
avx and avx512 are indeed different. However, I don't think that |
Actually, I'm wondering if this is even relevant anymore. This test has recently been moved to On the other hand, looking at #44056 this test is supposed to test an issue that only occurs when the compiled binary is executed. Maybe it should not have been moved? /cc @RalfJung |
Yeah maybe it should not have been moved, sorry. :/ Certainly won't do that again. |
@@ -10,6 +10,7 @@ | |||
|
|||
// compile-pass | |||
// only-x86_64 | |||
// gate-test-avx512_target_feature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gate-test
is AFAIK used to indicate that this is a "feature gate test", to check the policy that every feature gate comes with a test making sure stuff is indeed gated.
You want some kind of only-
annotation here to run the test only when certain conditions are met.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the syntax for "only"? I grep through the code and only see // only-$arch
and it's not obvious where the docs for this stuff is...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem like avx
is valid for that: https://rust-lang-nursery.github.io/rustc-guide/tests/adding.html#ignoring-tests :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only
and ignore
accept the same flags, maybe you can grep for ignore
?
The code for this is at
rust/src/tools/compiletest/src/header.rs
Line 726 in 0117b42
fn parse_cfg_name_directive(&self, line: &str, prefix: &str) -> ParsedNameDirective { |
@@ -10,6 +10,7 @@ | |||
|
|||
// compile-pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is compile-pass
, why is it being run ?
As in, we can cross-compile for x86_64
with avx
from all x86_64
toolchains, and the tests checks that doing so works AFAICT, but this test shouldn't run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the logs:
---- [ui] ui/run-pass/issues/issue-44056.rs stdout ----
it does appear that this test is in fact being run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #55667 (comment). This test was recently moved to compile-pass (but should not have been, as the original issue requires execution).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, looking at the issue, this test does need execution. For that we would need a way to filter tests by target features available at run-time. Shouldn't be to hard to add a flag to prevent this tests from executing (e.g. using is_x86_feature_detected!("avx")
).
To make sure I'm getting this right, as pointed out by others the @infinity0 is the PR still needed in light of that information? |
This was an oversight and should be reverted (this test has to run), so this issue will still need fixing. |
Yes this issue still needs fixing but the current PR is not approriate.
I tried this, but this defeats the point of the test. The problem is that if you do something like #![target_feature(enabled = "avx")]
fn main1() {}
fn main() { if is_x86_feature_detected!("avx") { main1() } } no AVX instructions actually get generated and the original point of the test is defeated. The originally-problematic instructions ( We basically need the test runner to conditionally run the whole program as a separate process, but |
We do have a couple tests that use |
@infinity0 Oh no, that's not what I meant! What I meant is to do run-time feature detection to decide whether the test must be run at all (from the parent process). The current test runner already has a lot of logic to decide when to run each test. So maybe we can add a FWIW, we don't have to implement a super-general system for running tests depending on the host target features right now. That is, it is fine to just "hack" something in the test runner that handles this case properly. If we ever need to do this again, we can consider improving the test runner further. |
r? @gnzlbg Sounds like y'all have a lot more opinions/thoughts about this than I |
@gnzlbg Do you think you'll get a chance to make a review happen here soon? |
I think @infinity0 might have forgotten to close this. This tests was moved by mistake, so the issue this PR attempts to fix should not be happening any more. |
The issue shouldn't be closed, it still exists. It's just now hidden by another bug (the incorrect move) so it won't be visible in current builds. |
As of yesterday, I am still seeing this test fail when I do |
@infinity0 this is not an issue, its a PR, with a fix approach that won't fix the issue. Maybe you could open a proper issue for this? @RalfJung due to the other bug @infinity0 mentions this test shouldn't currently ever run at all. If that reproduces, we should fill a second bug for this. |
Never mind, this was a case of #55537. |
I've opened this issue so that we don't forget about this: #55996 We should close this PR, revert the change that moved this test, and then send a PR that improves the test runner so that this test can be skipped if the hardware doesn't support AVX. |
thanks, closing in favour of further discussion on issue #55996 |
Otherwise it fails with SIGILL, e.g. on binet.debian.org: